<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>发布帖子</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/style/front/css/base.css"/>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/style/front/css/style.css"/>
</head>

<body>
<div class="head-box">
    <div class="head wrap">
          <div class="logo fl"><a href=""><img src="${pageContext.request.contextPath}/static/style/front/images/logo.png"/></a></div>
          <div class="head-right fr">
              <div class="head-a fr">
                   <% if(session.getAttribute("users")==null){ %>
                   <div class="head-a3 login-click fl"><a href="${pageContext.request.contextPath}/login">登录</a></div>
                   <div class="head-a4 reg-click fl"><a href="${pageContext.request.contextPath}/login">注册</a></div>          
              
            <% }else{%>             		 
              <div class="tbt fl">
              		<a href="#">
              			<img src="${pageContext.request.contextPath}/${users.picture}" style="display: inline-block;height: auto;max-width: 100%;"/>
                   </a>     
               </div>
             <%} %>     
              </div>
              <div class="clearfix"></div>
              <div class="nav fr">
                  <ul>
                       <li><a href="#">首页</a></li>
                       <li><a href="#">文章</a>
                           <div class="sub-nav">
                                <div class="bich-top"></div>
                                 <div class="bich">
                                     <a href="">服饰</a>
                                     <a href="">美食</a>
                                     <a href="">出行</a>
                                     <a href="">约会</a>
                                 </div>
                           
                           </div>
                       </li>
                       <li><a href="#">社区</a></li>
                       <li><a href="#">课程</a></li>
                       <li><a href="#">活动</a></li>
                       <li><a href="#">联系我们</a></li>
                  
                  </ul>
              </div>
              <div class="clearfix"></div>
          </div>
    </div>
</div>

<div class="content">
    <div class="wrap">
         <div class="tsm-height"></div>
         <div class="account">
         	<form id="productGroup" class="form-horizontal"
								action="${pageContext.request.contextPath}/fronts/post"
								method="post">
                 <div class="tsm-box">                     
                      <div class="tsm-a" style="display:block;">
                                   <div class="tsm-a1">
                                         <div class="tsm-a2 fl">帖子标题：</div>
                                         <div class="tsm-a3"><input type="text" class="tsm-text1" name="title" value=""/></div>
                                   </div>
                                   <div class="tsm-a1">
                                         <div class="tsm-a2 fl">帖子标签：</div>
                                         <div class="tsm-a3">
                                         	<select class="form-control" name="label.id" >
                      						<c:forEach items="${list}" var="item">
                        						<option value="${item.id}">${item.name}</option> 
                       			 			</c:forEach>                     
                       						</select>
                       					</div>
                                   </div>
                                   <div class="tsm-a1">
                                         <div class="tsm-a2 fl">版块：</div>
                                         <div class="tsm-a3">
                                         	<select class="form-control" name="categorys.id" >
                      						<c:forEach items="${cList}" var="item">
                        						<option value="${item.id}">${item.name}</option> 
                       			 			</c:forEach>                     
                       						</select>
                       					</div>
                                   </div>
                                      <input name="user.id" type="hidden" value="${users.id}"/>                                                                
                                   <div class="tsm-a1">
                                         <div class="tsm-a2 fl">帖子内容：</div>
                                         <div class="det-b1">
                                      <textarea class="det-area post-area" name="content"></textarea>
                                 </div>
                                   </div>
                                   <div class="tsm-href"><input type="submit" class="tsm-btn" value="发表" /></div>      
                        </div>
                 </div> 
             </form>   
         </div>
    </div>
</div>

<div class="footer">
   <div class="wrap">
      <div class="foot">
            <div class="foot-left fl">
                 <a href="">关于我们</a>
                 <a href="">加入我们</a>
                 <a href="">联系我们</a>
                 <a href="">媒体采访</a>
            </div>
            <div class="foot-c fl"><a href=""><img src="${pageContext.request.contextPath}/static/style/front/images/foot-logo.jpg"/></a></div>
            <div class="foot-right fr">
                 <a href="">同城活动</a>
                 <a href="">课程资讯</a>
                 <a href="">最新发布</a>
                 <a href="">热门文章</a>
            </div>
       </div> 
       <div class="foot-btm">高新出品</div>    
   </div>
</div>

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/Action.js"></script>

<!--<script type="text/javascript">
                //图片上传预览    IE是用了滤镜。
        function previewImage(file)
        {
          var MAXWIDTH  = 122; 
          var MAXHEIGHT = 122;
          var div = document.getElementById('preview');
          if (file.files && file.files[0])
          {
              div.innerHTML ='<img id=imghead>';
              var img = document.getElementById('imghead');
              img.onload = function(){
                var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
                img.width  =  rect.width;
                img.height =  rect.height;
//                 img.style.marginLeft = rect.left+'px';
                img.style.marginTop = rect.top+'px';
              }
              var reader = new FileReader();
              reader.onload = function(evt){img.src = evt.target.result;}
              reader.readAsDataURL(file.files[0]);
          }
          else //兼容IE
          {
            var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
            file.select();
            var src = document.selection.createRange().text;
            div.innerHTML = '<img id=imghead>';
            var img = document.getElementById('imghead');
            img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
            var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
            status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
            div.innerHTML = "<div id=divhead style='width:"+rect.width+"px;height:"+rect.height+"px;margin-top:"+rect.top+"px;"+sFilter+src+"\"'></div>";
          }
        }
        function clacImgZoomParam( maxWidth, maxHeight, width, height ){
            var param = {top:0, left:0, width:width, height:height};
            if( width>maxWidth || height>maxHeight )
            {
                rateWidth = width / maxWidth;
                rateHeight = height / maxHeight;
                 
                if( rateWidth > rateHeight )
                {
                    param.width =  maxWidth;
                    param.height = Math.round(height / rateWidth);
                }else
                {
                    param.width = Math.round(width / rateHeight);
                    param.height = maxHeight;
                }
            }
             
            param.left = Math.round((maxWidth - param.width) / 2);
            param.top = Math.round((maxHeight - param.height) / 2);
            return param;
        }
</script> -->
</body>
</html>
